﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterALSafa.Master" AutoEventWireup="true"
    CodeBehind="TE_Subject.aspx.cs" Inherits="School.Pages.Teaching.TE_Subject" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <table dir="rtl" style="width: 100%; float: right">
        <tr>
            <td>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <table align="right" dir="rtl" style="width: 100%; float: right">
                            <tr>
                                <td colspan="2" class="admintitle" align="center">
                                    ادخال بيانات
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap">
                                    المجمع
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlCampus" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                        DataTextField="Name" DataValueField="Id" OnTextChanged="ddlCampus_TextChanged"
                                        Width="150px">
                                        <asp:ListItem Value="0">اختيار</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="ddlCampus"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap">
                                    الشهاده
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlCertificate" runat="server" AppendDataBoundItems="True"
                                        AutoPostBack="True" DataTextField="Name" DataValueField="Id" OnSelectedIndexChanged="ddlCertificate_SelectedIndexChanged"
                                        Width="150px" TabIndex="1">
                                        <asp:ListItem Value="0">اختيار</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="ddlCertificate"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap">
                                    المرحله
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlStadge" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                        DataTextField="Name" DataValueField="Id" OnSelectedIndexChanged="ddlStadge_SelectedIndexChanged"
                                        Width="150px" TabIndex="2">
                                        <asp:ListItem Value="0">اختيار</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="ddlStadge"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap">
                                    الصف
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlGrade" runat="server" AppendDataBoundItems="True" DataTextField="Name"
                                        DataValueField="Id" Width="150px" TabIndex="3" AutoPostBack="True" OnSelectedIndexChanged="ddlGrade_SelectedIndexChanged">
                                        <asp:ListItem Value="0">اختيار</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="ddlGrade"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap">
                                    اسم المادة
                                </td>
                                <td>
                                    <asp:TextBox ID="txtname" runat="server" Width="150px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="txtname"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="st"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap">
                                    الوصف
                                </td>
                                <td>
                                    <asp:TextBox ID="txtdis" runat="server" TextMode="MultiLine"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap">
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:Button ID="btnSave" runat="server" CssClass="graybutton" Text="اضافة" OnClick="btnSave_Click" />
                                    &nbsp;
                                    <asp:Label ID="lbltst" runat="server" Visible="False"></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <asp:GridView ID="gvsub" runat="server" AllowPaging="True" AlternatingRowStyle-CssClass="GridItemAltername"
                            AutoGenerateColumns="False" CssClass="Grid" DataKeyNames="Id" FooterStyle-CssClass="GridHeaderFooter"
                            HeaderStyle-CssClass="GridHeaderFooter" PagerStyle-CssClass="GridPager" OnPageIndexChanging="gvsub_PageIndexChanging"
                            OnRowCancelingEdit="gvsub_RowCancelingEdit" OnRowDataBound="gvsub_RowDataBound"
                            OnRowDeleting="gvsub_RowDeleting" OnRowEditing="gvsub_RowEditing" OnRowUpdating="gvsub_RowUpdating"
                            Width="80%">
                            <AlternatingRowStyle CssClass="GridItemAltername" />
                            <Columns>
                                <asp:TemplateField>
                                    <HeaderTemplate>
                                        م
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <%# Container.DataItemIndex + 1 %>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="Grad_name" HeaderText="الصف" ReadOnly="True" SortExpression="Grad_name" />
                                <asp:TemplateField HeaderText="المادة" SortExpression="Sub_name">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtNmae_E" runat="server" Text='<%# Bind("Sub_name") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ControlToValidate="txtNmae_E"
                                            Display="Dynamic" ErrorMessage="*" ForeColor="Red"></asp:RequiredFieldValidator>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Sub_name") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="الوصف" SortExpression="Description">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txt_Dis_E" runat="server" Text='<%# Bind("Description") %>' TextMode="MultiLine"></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Description") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:CommandField CancelText="إلغاء" EditText="تعديل" ShowEditButton="True" UpdateText="تحــديث" />
                                <asp:TemplateField ShowHeader="False">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lkdelete" runat="server" CausesValidation="False" CommandName="Delete"
                                            Text="حذف"></asp:LinkButton>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle CssClass="GridHeaderFooter" />
                            <HeaderStyle CssClass="GridHeaderFooter" />
                            <PagerStyle CssClass="GridPager" />
                        </asp:GridView>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
</asp:Content>
